<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <!--1.阻止冒泡 @click.stop -->
  <div class="box" @click="boxClick">
    <button @click.stop="btnClick">点我</button>
  </div>
</div>


<script src="../js/vue.js"></script>
<script>
  // 1.创建Vue的实例对象
  const app = Vue.createApp({
    data(){
      return {
        count: 0,
      }
    },
    methods:{
      boxClick(){
        console.log('点击了盒子')
      },
      btnClick(){
        console.log('点击了按钮')
      }
    }
  }).mount('#app');
</script>
</body>
</html>